Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop translating underscores in configure args #107

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

runderwo
Copy link

This breaks nginx configuration. See the configure arguments here:
https://github.com/nginx/nginx/blob/master/auto/options

Is there a good reason for this translation? Somehow the user didn't actually intend an underscore?

@bernd
Copy link
Owner

bernd commented Jul 25, 2015

The translation was introduced as syntactic sugar so you can use :with_foo => 'bar'. I agree that it is confusing and breaks for some cases. But removing it might break lots of recipes.

You can use a regular string argument as a workaround though:

configure \
      '--with-http_stub_status_module',
      '--with-http_ssl_module',
      '--with-http_gzip_static_module',
      '--with-pcre',
      '--with-debug'

See my example nginx recipe: https://github.com/bernd/fpm-recipes/blob/master/nginx/recipe.rb#L24-L29

Hope that helps.

@runderwo
Copy link
Author

If you're not going to fix it, then at least warn when you see an underscore in a configure argument and point to the recommended workaround.

My workaround was:

    configure = './configure'
    args.each do |k, v|
        if v == true
            configure += " --#{k}"
        else
            configure += " --#{k}=#{v}"
        end
    end
    safesystem configure

@bernd bernd changed the base branch from master to main July 13, 2022 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants